﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Walking.Master" CodeBehind="routeinfo.aspx.vb" Inherits="walkingweb.routeinfo" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style4
        {
            width: 41px;
        }
        .style5
        {
        }
         /* Rating */
        .ratingStar
        {
            font-size: 0pt;
            width: 13px;
            height: 12px;
            margin: 0px;
            padding: 0px;
            cursor: pointer;
            display: block;
            background-repeat: no-repeat;
        }
        .filledRatingStar
        {
            background-image: url(images/starfilled.png);
        }
        .emptyRatingStar
        {
            background-image: url(images/starempty.png);
        }
        .savedRatingStar
        {
            background-image: url(images/starsaved.png);
        }
        /* End Rating */
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <p>
        <br />
        <asp:FormView ID="FormView1" runat="server" DataKeyNames="RouteID" 
            DataSourceID="routeinfodisplay" Width="600px">
            <EditItemTemplate>
                RouteID:
                <asp:Label ID="RouteIDLabel1" runat="server" Text='<%# Eval("RouteID") %>' />
                <br />
                RouteName:
                <asp:TextBox ID="RouteNameTextBox" runat="server" 
                    Text='<%# Bind("RouteName") %>' />
                <br />
                CityTown:
                <asp:TextBox ID="CityTownTextBox" runat="server" 
                    Text='<%# Bind("CityTown") %>' />
                <br />
                County:
                <asp:TextBox ID="CountyTextBox" runat="server" Text='<%# Bind("County") %>' />
                <br />
                Country:
                <asp:TextBox ID="CountryTextBox" runat="server" Text='<%# Bind("Country") %>' />
                <br />
                Description:
                <asp:TextBox ID="DescriptionTextBox" runat="server" 
                    Text='<%# Bind("Description") %>' />
                <br />
                Distance:
                <asp:TextBox ID="DistanceTextBox" runat="server" 
                    Text='<%# Bind("Distance") %>' />
                <br />
                Picture:
                <asp:TextBox ID="PictureTextBox" runat="server" Text='<%# Bind("Picture") %>' />
                <br />
                DetailsFile:
                <asp:TextBox ID="DetailsFileTextBox" runat="server" 
                    Text='<%# Bind("DetailsFile") %>' />
                <br />
                DateAdded:
                <asp:TextBox ID="DateAddedTextBox" runat="server" 
                    Text='<%# Bind("DateAdded") %>' />
                <br />
                Visitor:
                <asp:TextBox ID="VisitorTextBox" runat="server" Text='<%# Bind("Visitor") %>' />
                <br />
                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                    CommandName="Update" Text="Update" />
                &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </EditItemTemplate>
            <InsertItemTemplate>
                RouteName:
                <asp:TextBox ID="RouteNameTextBox" runat="server" 
                    Text='<%# Bind("RouteName") %>' />
                <br />
                CityTown:
                <asp:TextBox ID="CityTownTextBox" runat="server" 
                    Text='<%# Bind("CityTown") %>' />
                <br />
                County:
                <asp:TextBox ID="CountyTextBox" runat="server" Text='<%# Bind("County") %>' />
                <br />
                Country:
                <asp:TextBox ID="CountryTextBox" runat="server" Text='<%# Bind("Country") %>' />
                <br />
                Description:
                <asp:TextBox ID="DescriptionTextBox" runat="server" 
                    Text='<%# Bind("Description") %>' />
                <br />
                Distance:
                <asp:TextBox ID="DistanceTextBox" runat="server" 
                    Text='<%# Bind("Distance") %>' />
                <br />
                Picture:
                <asp:TextBox ID="PictureTextBox" runat="server" Text='<%# Bind("Picture") %>' />
                <br />
                DetailsFile:
                <asp:TextBox ID="DetailsFileTextBox" runat="server" 
                    Text='<%# Bind("DetailsFile") %>' />
                <br />
                DateAdded:
                <asp:TextBox ID="DateAddedTextBox" runat="server" 
                    Text='<%# Bind("DateAdded") %>' />
                <br />
                Visitor:
                <asp:TextBox ID="VisitorTextBox" runat="server" Text='<%# Bind("Visitor") %>' />
                <br />
                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                    CommandName="Insert" Text="Insert" />
                &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </InsertItemTemplate>
            <ItemTemplate>
                <br />
                <table align="left" border="0" bordercolor="#333333" cellpadding="2" 
                    cellspacing="0" class="style1" width="100%">
                    <tr>
                        <td class="style5">
                            <table bgcolor="#CCCCCC" border="1" bordercolor="#333333" class="style1">
                                <tr>
                                    <td>
                                        <asp:Image ID="Image1" runat="server" ImageAlign="AbsMiddle" 
                                            ImageUrl='<%# Eval("Picture") %>' />
                                    </td>
                                </tr>
                            </table>
                            <br />
                        </td>
                        <td align="center">
                            <asp:Label ID="RouteNameLabel" runat="server" Font-Bold="True" 
                                Font-Size="Medium" Text='<%# Bind("RouteName") %>' />
                            <br />
                            <hr width="50%" />
                            <br />
                            <asp:Label ID="CityTownLabel" runat="server" Font-Size="Small" 
                                Text='<%# Bind("CityTown") %>' />
                            <br />
                            <asp:Label ID="CountyLabel" runat="server" Font-Size="Small" 
                                Text='<%# Bind("County") %>' />
                            <br />
                            <asp:Label ID="CountryLabel" runat="server" Font-Size="Small" 
                                Text='<%# Bind("Country") %>' />
                            <br />
                            Distance (km):<asp:Label ID="DistanceLabel" runat="server" Font-Size="Small" 
                                Text='<%# Bind("Distance") %>' />
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td class="style5" colspan="2">
                            Description:<br />
                            <asp:Label ID="DescriptionLabel" runat="server" Font-Size="Small" 
                                Text='<%# Bind("Description") %>' />
                        </td>
                    </tr>
                    <tr>
                        <td class="style5" colspan="2">
                            <asp:HyperLink ID="HyperLink1" runat="server" 
                                NavigateUrl="~/routedetails/1e0c6bf2-f3af-4672-a833-6bdec4d84f47.doc">Download</asp:HyperLink>
                            &nbsp;file for more details.</td>
                    </tr>
                </table>
                <br />
                <br />

            </ItemTemplate>
        </asp:FormView>
        <asp:SqlDataSource ID="routeinfodisplay" runat="server" 
            ConnectionString="<%$ ConnectionStrings:walkingweb %>" 
            ProviderName="<%$ ConnectionStrings:walkingweb.ProviderName %>" 
            SelectCommand="SELECT * FROM [routes] WHERE ([RouteID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="RouteID" QueryStringField="RouteID" 
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <hr />
    <p>
        Comments</p>
    <p>
        <asp:DataList ID="DataList1" runat="server" DataKeyField="RouteCommentID" 
            DataSourceID="routecommentsview">
            <ItemTemplate>
                <asp:Label ID="VisitorLabel" runat="server" Font-Bold="True" 
                    Text='<%# Eval("Visitor") %>' />
                &nbsp; @
                <asp:Label ID="WebsiteURLLabel" runat="server" 
                    Text='<%# Eval("WebsiteURL") %>' />
&nbsp;
                <asp:Label ID="DatePostedLabel" runat="server" 
                    Text='<%# Eval("DatePosted") %>' />
                <br />
                Title:
                <asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>' />
                <br />
                <asp:Label ID="ContentLabel" runat="server" Text='<%# Eval("Content") %>' />
                <hr />
            </ItemTemplate>
        </asp:DataList>
        <asp:SqlDataSource ID="routecommentsview" runat="server" 
            ConnectionString="<%$ ConnectionStrings:walkingweb %>" 
            ProviderName="<%$ ConnectionStrings:walkingweb.ProviderName %>" 
            SelectCommand="SELECT * FROM [routecomments] WHERE ([RouteID_fk] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="RouteID_fk" QueryStringField="RouteID" 
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <p style="width: 707px">
        Let us know what you think.&nbsp; Comment and Rate this route below (members only - 
        <asp:LoginStatus ID="routecommentlogin" runat="server" />
&nbsp;or
        <asp:HyperLink ID="HyperLink2" runat="server" 
            NavigateUrl="~/Account/Register.aspx">Register to comment</asp:HyperLink>
        ).</p>
    <p style="width: 792px">
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>
        Have you walked this Rote?&nbsp; Why not leave your rating.<asp:Rating ID="ajc_rateroute" runat="server"
    CurrentRating="0"
    MaxRating="5"
    StarCssClass="ratingStar"
    WaitingStarCssClass="savedRatingStar"
    FilledStarCssClass="filledRatingStar"
    EmptyStarCssClass="emptyRatingStar">
    </asp:Rating> <br /><asp:Button ID="btn_rateroute" runat="server" Text="Rate Route Now!" />
    <br />
        <hr />  
    <p style="width: 224px">Add your comment </p>
    <p style="width: 651px">
        Name:&nbsp;
        <asp:Label ID="lbl_routecommentname" runat="server" Text="Label"></asp:Label> 
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<asp:LoginStatus ID="commentasmember" runat="server" 
            LoginText="Log in to comment as member" LogoutText="" />
    </p>
    <p style="width: 508px">
        Email (required)<br />
&nbsp;<asp:TextBox ID="tb_routecommentemail" runat="server"></asp:TextBox>
    </p>
    <p style="width: 507px">
        Website URL (optional):<br />
        <asp:TextBox ID="tb_routecommenturl" runat="server"></asp:TextBox>
    </p>
    <p style="width: 510px">
        Title of comment (required, 50 character limit):<br />
        <asp:TextBox ID="tb_routecommenttitle" runat="server"></asp:TextBox>
    </p>
    <p>
        Your comment below (required, 2000 character limit)<br />
        <asp:TextBox ID="tb_routecommentcontent" runat="server" Height="252px" TextMode="MultiLine" 
            Width="489px"></asp:TextBox>
    <p>
        <asp:Button ID="btn_routecommentadd" runat="server" Text="Add Comment" />
    </p>
     </p>
    <hr />
    <p>Tag the route
    </p>
    <asp:CheckBoxList ID="cbl_addexistingtag" runat="server" 
        DataSourceID="routetags" DataTextField="TagText" DataValueField="TagID" 
        RepeatDirection="Horizontal">
    </asp:CheckBoxList>
    <br />
    <br />
    <p style="width: 724px">
    Please add any additional tags you would like to associate with this route (separate each word with a comma).
    <asp:TextBox ID="tb_newroutetags" runat="server" Width="300px"></asp:TextBox>
    <asp:SqlDataSource ID="routetags" runat="server" 
        ConnectionString="<%$ ConnectionStrings:walkingweb %>" 
        ProviderName="<%$ ConnectionStrings:walkingweb.ProviderName %>" 
        SelectCommand="SELECT * FROM [tags]"></asp:SqlDataSource>
    <asp:Button ID="btn_routetagadd" runat="server" Text="Tag this Route!" />
    </p>
    <p style="width: 724px">
    <br />
    </p>
</asp:Content>
